using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using eShop.Business;
using ECommerce.Library.Web;
using eShop.Business;

public partial class pre_checkout : SitePublicBasePage
{
    
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
           CheckoutStepsValidate();
        }
    }

    private void CheckoutStepsValidate()
    {
        if (ShoppingCartManager.HasAnyItemInCart() == false)
            Response.Redirect(eShop.Business.CustomSiteMap.ShoppingCart);

        if (SessionManager.CheckoutSteps < CheckoutSteps.ShoppingCart)
        {
            Response.Redirect(eShop.Business.CustomSiteMap.ShoppingCart);
        }     
            
    }

    protected void Signin_Click(object sender, EventArgs e)
    {
        SessionManager.CheckoutSteps = CheckoutSteps.PreCheckout;
        SessionManager.ReturnUrl = eShop.Business.CustomSiteMap.OrderSummary;
        String redirectUrl = eShop.Business.CustomSiteMap.Login;
        Response.Redirect(redirectUrl);
        
    }

    protected void Checkout_Click(object sender, EventArgs e)
    {
        SessionManager.CheckoutSteps = CheckoutSteps.PreCheckout;
        String redirectUrl = eShop.Business.CustomSiteMap.OrderSummary;
        Response.Redirect(redirectUrl);
    }
}
